import Layout from '@/layout'

const managerGoodsRouter = {
  path: '/manager/goods',
  component: Layout,
  redirect: 'noRedirect',
  alwaysShow: true,
  name: 'ManagerGoods',
  meta: {
    title: '商品管理',
    roles: ['manager', 'admin']
  },
  children: [
    {
      path: 'inventory/upload',
      component: () => import('@/views/manager/goods/inventory-upload'),
      name: 'ManagerInventoryUpload',
      meta: { title: '库存上传', noCache: true }
    },
    {
      path: 'inventory/download',
      component: () => import('@/views/manager/goods/inventory-download'),
      name: 'ManagerInventoryDownload',
      meta: { title: '库存导出', noCache: true }
    },
    {
      path: 'product-inventory',
      component: () => import('@/views/manager/goods/product-inventory'),
      name: 'ManagerProductInventory',
      meta: { title: '库存查询', noCache: false }
    },
    {
      path: 'product',
      component: () => import('@/views/manager/goods/product-list'),
      name: 'ManagerProduct',
      meta: { title: '商品信息', noCache: false }
    },
    {
      path: 'product/add',
      component: () => import('@/views/manager/goods/product-add'),
      name: 'ManagerProductAdd',
      meta: { title: '新增商品', noCache: false },
      hidden: true
    },
    {
      path: 'product/:id(\\d+)/edit',
      component: () => import('@/views/manager/goods/product-edit'),
      name: 'ManagerProductEdit',
      meta: { title: '商品编辑', noCache: false },
      hidden: true
    },
    {
      path: 'size',
      component: () => import('@/views/manager/goods/size-list'),
      name: 'ManagerSize',
      meta: { title: '尺码信息', noCache: false }
    },
    {
      path: 'size/:id(\\d+)/edit',
      component: () => import('@/views/manager/goods/size-edit'),
      name: 'ManagerSizeEdit',
      meta: { title: '尺码编辑', noCache: false },
      hidden: true
    },
    {
      path: 'barcode',
      component: () => import('@/views/manager/goods/barcode-list'),
      name: 'ManagerBarcode',
      meta: { title: '条形码信息', noCache: false }
    },
    {
      path: 'barcode/:id(\\d+)/edit',
      component: () => import('@/views/manager/goods/barcode-edit'),
      name: 'ManagerBarcodeEdit',
      meta: { title: '条形码编辑', noCache: false },
      hidden: true
    }
  ]
}

export default managerGoodsRouter
